#! /usr/bin/sdlbrt

'- picture converter - Mattel Aquarius - b&w version (based on a zx81 picture converter) - Paulo Silva - July'10 - GPL licence 

finp$="picture.jpg"

finp2$="_tmpr_m.png"
shell("convert -modulate 100,0 "+finp$+" "+finp2$)

onlgr=0
xed=0:yed=0
open finp2$ for input as #1
  for i=1 to 16:n=readbyte(1):next:for i=1 to 2:n=readbyte(1):next
  xed=readbyte(1)*256:xed=xed+readbyte(1)
  for i=1 to 2:n=readbyte(1):next:yed=readbyte(1)*256:yed=yed+readbyte(1)
  close #1

xed2a=xed*4:xed2disp=xed2a:if xed2disp<(160+xed) then: xed2disp=160+xed:end if
yed2a=yed*4:yed2disp=yed2a+256:if yed2disp<(yed2a+yed) then:yed2disp=yed2a+yed:end if

setdisplay(xed2disp,yed2disp,32,1):paper(0xCC8844):ink(0):pen(0):cls
loadimage(finp2$,1): pasteicon(160,yed2a,1)

sub filpic7(qxx1,qyy1,qstq$)
  yyt=qyy1:xxt=qxx1:tstt$=qstq$
  for qq=0 to len(tstt$)-1
    qu=(((val(mid$(tstt$,qq+1,1)))*255)/7):ink(rgb(qu,qu,qu)):dot(xxt+qq,yyt):next
  end sub

filpic7(0,yed2a+000,"77777777777007777000007777700077700007777000000770000007777000777077770777700077777700077077770770777777707777077077770777700777")
filpic7(0,yed2a+001,"77777777770770777707770777077707770770777077777770777777770777077077770777770777777770777077707770777777700770077007770777077077")
filpic7(0,yed2a+002,"77777777707777077707770770777777770777077077777770777777707777777077770777770777777770777077077770777777707007077070770770777707")
filpic7(0,yed2a+003,"77777777700000077700007770777777770777077000077770000777707700077000000777770777777770777000777770777777707007077077070770777707")
filpic7(0,yed2a+004,"77777777707777077707770770777777770777077077777770777777707777077077770777770777777770777077077770777777707777077077700770777707")
filpic7(0,yed2a+005,"77777777707777077707770777077707770770777077777770777777770777077077770777770777707770777077707770777777707777077077770777077077")
filpic7(0,yed2a+006,"77777777707777077000007777700077700007777000000770777777777000777077770777700077770007777077770770000007707777077077770777700777")
filpic7(0,yed2a+007,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+008,"70000077777007777000007777000077770000077077770770777707707777077077770777077707700000077777077777770777777707777777077777770777")
filpic7(0,yed2a+009,"70777707770770777077770770777707777707777077770770777707707777077077770777077707777777077777077777770777777707777777077777770777")
filpic7(0,yed2a+010,"70777707707777077077770770777777777707777077770770777707707777077707707777077707777770777777077777770777777707777777077777770777")
filpic7(0,yed2a+011,"70000077707777077000007777000077777707777077770777077077707007077770077777700077777007777777077777770777777707777777077777770777")
filpic7(0,yed2a+012,"70777777707707077077077777777707777707777077770777077077707007077707707777770777770777770000000077770000000007777777000000000000")
filpic7(0,yed2a+013,"70777777770770777077707770777707777707777077770777700777700770077077770777770777707777777777077777777777777777777777077777777777")
filpic7(0,yed2a+014,"70777777777007077077770777000077777707777700007777700777707777077077770777770777700000077777077777777777777777777777077777777777")
filpic7(0,yed2a+015,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777077777777777777777777777077777777777")
filpic7(0,yed2a+016,"77000077777707777700007777000077777770777000000777700077700000077700007777000077777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+017,"70777707777007777077770770777707777700777077777777077777707777077077770770777707777777777777777777777777777777077777777777777777")
filpic7(0,yed2a+018,"70777007770707777777770777777707777070777000077770777777777770777077770770777707777777777000000777770777777770777777777777777777")
filpic7(0,yed2a+019,"70700707777707777777007777000077770770777777707770000077777707777700007777000007700000077777777777777777777707777777777777777777")
filpic7(0,yed2a+020,"70077707777707777700777777777707700000077777770770777707777077777077770777777707777777777000000777777777777077777777777777777777")
filpic7(0,yed2a+021,"70777707777707777077777770777707777770777077707770777707777077777077770777777077777777777777777777770777770777777770077777770777")
filpic7(0,yed2a+022,"77000077770000077000000777000077777770777700077777000077777077777700007777000777777777777777777777770777707777777770077777770777")
filpic7(0,yed2a+023,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777707777777777777777777777707777")
filpic7(0,yed2a+024,"77777777707777770777777777777770777777777770777700000000007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+025,"00000000707777770777777777777770777777777770777700000000007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+026,"77777777707777770777777777777770777777777770777777777777007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+027,"77777777707777770777777777777770000000007770777777777777007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+028,"77777777707777770777777777777770777777777770777777777777007777777777777777777077000000007777000077777777777777707777777777777700")
filpic7(0,yed2a+029,"77777777707777770777777777777770777777777770777777777777007777770000000077777077000000007777000077777777777777707777777777777700")
filpic7(0,yed2a+030,"77777777707777770777777777777770777777777770777777777777007777777777777777777077000000007777000077777777777777700000000077777700")
filpic7(0,yed2a+031,"77777777707777770000000000000000777777777770777777777777007777777777777777777077000000007777000000000000777777700000000077777700")
filpic7(0,yed2a+032,"77777777777707770000000000000000777707777777777777770777777777777777777777000077000000007777777777777777077777777777777077777777")
filpic7(0,yed2a+033,"77777777777000777000000000000000777000777777777777700077770000777700007770777707007777007777777777777777007777777777770077777777")
filpic7(0,yed2a+034,"77770777770000077700000000000000770000077770777777070707700000077077770777777707077777707777777777777777000777777777700077770777")
filpic7(0,yed2a+035,"77777077700000007770000000000000700000007707777770000000700000077077770777770077077777707777777777777777000077777777000077777777")
filpic7(0,yed2a+036,"00000007700000007777000000000000770000077000000077070707700000077077770777707777077777707777770000777777000007777770000077777777")
filpic7(0,yed2a+037,"77777077777000777777700000000000777000777707777777770777700000077077770777777777077777707777707777077777000000777700000077770777")
filpic7(0,yed2a+038,"77770777770000077777770000000000777707777770777777770777770000777700007777707777007777007777077777707777000000077000000077777777")
filpic7(0,yed2a+039,"77777777777777777777777000000000777777777777777777777777777777777777777777777777000000007777077777707777000000000000000077777777")
filpic7(0,yed2a+040,"77777777777700077700007777007007770000777770007700000000700077770707777777777777070707070000777777777777777777777777077777777777")
filpic7(0,yed2a+041,"77770777777007777707777770000000777770777707770700000007777007777070777770777777707070700000777777777777777777777777077777777777")
filpic7(0,yed2a+042,"77700077770077777707777770000000777770777077070700000077777700770707777777077777070707070000777777777777777777777777077777777777")
filpic7(0,yed2a+043,"77070707700777777707777770000000777770777070700700000777777770077070777777707777707070700000777777777777777777777777077777777777")
filpic7(0,yed2a+044,"77770777770077777707777777000007777770777077007700007777777700770707777777770777070707077777000077770000000077770000077700000000")
filpic7(0,yed2a+045,"77770777777007777707777777700077777770777707777700077777777007777070777777777077707070707777000077770777777077777777077777770777")
filpic7(0,yed2a+046,"77770777777700077700007777770777770000777770000700777777700077770707777777777707070707077777000077770777777077777777077777770777")
filpic7(0,yed2a+047,"77777777777777777777777777777777777777777777777707777777777777777070777777777777707070707777000077770777777077777777077777770777")
filpic7(0,yed2a+048,"77777777777707777707707777077077777707777777777777007777777770777777707777077777777777777777077777770000077777707770777777770777")
filpic7(0,yed2a+049,"77777777777707777707707777077077777000077007770770770777777707777777077777707777777707777707070777770000707777077770777777770777")
filpic7(0,yed2a+050,"77777770777707777707707770000007770707777007707770770777777077777770777777770777777707777770007777770000770770777707777777777077")
filpic7(0,yed2a+051,"77000007777707777777777777077077777000777777077777007777777777777770777777770777770000077700000777770000777007770077777777777700")
filpic7(0,yed2a+052,"70707077777777777777777770000007777707077770777770770707777777777770777777770777777707777770007700007777777007777777777777777777")
filpic7(0,yed2a+053,"77707077777777777777777777077077777000777707700770777077777777777777077777707777777707777707070700007777770770777777777777777777")
filpic7(0,yed2a+054,"77707077777707777777777777077077777707777077700777000707777777777777707777077777777777777777077700007777707777077777777777777777")
filpic7(0,yed2a+055,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777700007777077777707777777777777777")
filpic7(0,yed2a+056,"00000000077777770000000000000000777777777707777777777770077777777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+057,"77777777077777770777777777777770777777777707777777777707707777777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+058,"77777777077777770777777777777770000000007707777777777077770777777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+059,"77777777077777770777777777777770777777777707777777770777777077777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+060,"77777777077777770777777777777770777777777707777777707777777707770000000077770777777777770000777777777777777777077777777777777000")
filpic7(0,yed2a+061,"77777777077777770777777777777770777777777707777777077777777770777777777777770777777777770000777777777777777777070000000077777000")
filpic7(0,yed2a+062,"77777777077777770777777777777770777777777707777770777777777777077777777777770777777777770000777700000000777777070000000077777000")
filpic7(0,yed2a+063,"77777777077777770777777777777770777777777707777707777777777777707777777777770777777777770000777777777777777777070000000077777000")
filpic7(0,yed2a+064,"77777777777770777777777777777777777777777777770777777777777707777777777777777777777777777777707777077077777777777777777777700077")
filpic7(0,yed2a+065,"77770777770007777700000777077707770077777777707777770777770000077770000777700077770000077777707777077077770000077770007777777777")
filpic7(0,yed2a+066,"77770777777707777777770777077707777777077777077777777077777707777770770777777777777777077777707777077077777077777777777777000007")
filpic7(0,yed2a+067,"77770777770000077777770777707707770077077770077777077707770000077707770777777777777777077777707777077077770000077770007777777707")
filpic7(0,yed2a+068,"77070707777707777777770777777707777777077707077777077707777707777777770777777777777070777777707777777077777077777777777777777707")
filpic7(0,yed2a+069,"77700077777707777777770777777077777770777777077777077707777707777777707777777777777707777777077777770777777077777700007777777077")
filpic7(0,yed2a+070,"77770777777077777700000777700777770007777777077777077707777707777770077777000007777770777770777777707777777700077777770777770777")
filpic7(0,yed2a+071,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+072,"77707777777777777777777777707777777077777777077777077777777000777770707777777777777777777777777777707777777000077777777777777777")
filpic7(0,yed2a+073,"77000007777000077700000777707777770000077777077777077777777777777700000777007777770707077700000777700007777077777777777777777777")
filpic7(0,yed2a+074,"77707707777077077777770777707777777077077700000777000007770000077770707777777777770707077707770777077077777077777700000777707777")
filpic7(0,yed2a+075,"77707077770707077777707777700777777077077777077777077777777707777770707777777707770707077707770777777077777077777777770777000007")
filpic7(0,yed2a+076,"77707777777770077777077777707077777077077777077777077777777707777777707777777707777777077707770777777077777777777777007777707707")
filpic7(0,yed2a+077,"77707777777770777770707777707777777077077770777777077777777707777777077777777077777770777707770777777077777777777777077777707077")
filpic7(0,yed2a+078,"77770007777007777707770777707777770770777707777777700007777077777770777777000777777707777700000777770777777777777770777777707777")
filpic7(0,yed2a+079,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+080,"77777777777777777777777777000007777707777777777777777077777077777777777777777777777707777777777777777777777777777777777777770777")
filpic7(0,yed2a+081,"77000007770000077700000777777707770000077700000777000007777077777770007777000007770000077770777777077777777777077777077777000007")
filpic7(0,yed2a+082,"77077707777777077777770777770707770777077777077777777077770000077777707777777707777707777707077777077777777777077707077777777077")
filpic7(0,yed2a+083,"77077707777070777777770777770077770777077777077777770077777077077777707777000007777707777777707777077707777070777707077777770777")
filpic7(0,yed2a+084,"77777707777707777777770777770777777777077777077777707077777070777777707777777707770707077777770777077077777707777707070777700077")
filpic7(0,yed2a+085,"77777077777070777777707777770777777770777777077777077077777077777777707777777707770707077777770777070777777070777707070777070707")
filpic7(0,yed2a+086,"77770777770777777770077777707777777707777700000777777077777077777700000777000007777707777777777777007777770777777707007777770777")
filpic7(0,yed2a+087,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+088,"77777777777777777777777777777777777777777777777777777777777777777000777777777777777777777777777777707777777777777777777777777777")
filpic7(0,yed2a+089,"77770777777777777777777777777777770000077777777777777777777777777070777777777777777777777777777770770777777777777777777777777777")
filpic7(0,yed2a+090,"77707777777777777777770777777777777777077777777777770777770000777000777777777777777777777777777777077777777777777777707777777777")
filpic7(0,yed2a+091,"77077777777707777777707777700077770000077777777777000007777770777777777777777777770000077707070777777777777777777700000777700077")
filpic7(0,yed2a+092,"77077707777707777777007777777077777777077077777777077707770000777777777777777777777707777707070777777777700077777777007777777777")
filpic7(0,yed2a+093,"77000007777707777770707777777077777770777707777777777707777770777777777777777777777707777777770777777777707077777770707777777777")
filpic7(0,yed2a+094,"77777707700007777777707777000007777707777770777777770077770000777777777777777777770000077777007777777777700077777707707777777777")
filpic7(0,yed2a+095,"77777777777777777777777777777777777777777777777777777777777777777777777777077777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+096,"77700077000000000000000000000000000000000700007000077700777007770007777777077707777000777777777777777777770777077700007777000077")
filpic7(0,yed2a+097,"77700077000070000000700000000000000000000700007000700070770770777077700077000007777000777770777007770777777070777000000770777707")
filpic7(0,yed2a+098,"77000007000070000007770000007000000700000700007007000000700000077077770777070707777707770070770770770700777707770000000007777770")
filpic7(0,yed2a+099,"77700077000070000070707000000700007000000777777007000000000000007000000777770777770000070000007777000000777707770070070007077070")
filpic7(0,yed2a+100,"77770777007070700000700007777770077777700700007007000000707007077077770777770777777707770070770770770700770000070000000007777770")
filpic7(0,yed2a+101,"77777777000777000000700000000700007000000700007000700070770770777077700070770770777707777770777007770777777707770007700007700770")
filpic7(0,yed2a+102,"77000007000070000000700000007000000700000700007000077700777777770007777770000000777070777777777777777777777000777000000770777707")
filpic7(0,yed2a+103,"77777777000000000000000000000000000000000000000000000000777777777777777770777770770777077777777777777777777000777700007777000077")
filpic7(0,yed2a+104,"77000007777000007777077777770777777707777777077777777777777707777707777777777077777707777700077770000000770777077777007777777777")
filpic7(0,yed2a+105,"77077707777077707707070777770770777707777770707777770777707707777700000770000007777070777770770770770770777070777770770700777777")
filpic7(0,yed2a+106,"77077707777000007707070777000707770000077700000777770777700000077077077770707077770777077000000070770770770000077770777700770777")
filpic7(0,yed2a+107,"77000007777077707777077777770077777707777077077077000007707707777700007770000000700000007770700070000000777707777700077770707077")
filpic7(0,yed2a+108,"77077707777000007770707777700077777000777700000777770777770000077707077770707777777077077700070070777770770000077770777770707077")
filpic7(0,yed2a+109,"77077707777077707707770777070707770707077770007777770777777707777000000770000000777077077070770770777770777707777770777770707070")
filpic7(0,yed2a+110,"77000007770777707077777070770770707707707000000070000000700000007777077777770707770770777770707770777770777707777700000777077707")
filpic7(0,yed2a+111,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+112,"77777777777777077777770777777777777777777777777777777777777777777777777707770777070707770777777777777777777707777777077770707070")
filpic7(0,yed2a+113,"77777777777777077777770777777777777700070000000070007777007770777707770007707777070077777077777777777777777707777770777707070707")
filpic7(0,yed2a+114,"77777777777777077777770777077777777077707777777707770777070770777707707007077777070007777707777777077077770000077707777770707070")
filpic7(0,yed2a+115,"77777777777777077777770770707777770777070777777070777077077070777707077000777777007777777770777777077077777777777770777707070707")
filpic7(0,yed2a+116,"77777777777777077777770707770777007770777077770777077700077700000000777000777777007777777770000000077000777777777777077770707070")
filpic7(0,yed2a+117,"77777707777777077777770777777070777770777077770777077777077070777707077007070777070777777707777777077077770000077777707707070707")
filpic7(0,yed2a+118,"00000000777770000000000077777707777777070777777070777777070770777707707007700777077077777077777777077077777707777777770770707070")
filpic7(0,yed2a+119,"77777707777777077777770777777777777777707777777707777777007770777707770007000777077707770777777777777777777707777777707707070707")
filpic7(0,yed2a+120,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+121,"77777777700077777777700070007000777777777000777777777000700070007777777770007777777770007000700077777777700077777777700070007000")
filpic7(0,yed2a+122,"77777777700077777777700070007000777777777000777777777000700070007777777770007777777770007000700077777777700077777777700070007000")
filpic7(0,yed2a+123,"77777777700077777777700070007000777777777000777777777000700070007777777770007777777770007000700077777777700077777777700070007000")
filpic7(0,yed2a+124,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+125,"77777777777777777777777777777777700077777000777770007777700077777777700077777000777770007777700070007000700070007000700070007000")
filpic7(0,yed2a+126,"77777777777777777777777777777777700077777000777770007777700077777777700077777000777770007777700070007000700070007000700070007000")
filpic7(0,yed2a+127,"77777777777777777777777777777777700077777000777770007777700077777777700077777000777770007777700070007000700070007000700070007000")
filpic7(0,yed2a+128,"77777777777777777077777777777777777777707777777777770077777777777077777777770777777770777077777777700777777777777777777777777777")
filpic7(0,yed2a+129,"77777777777777777077777777777777777777707777777777707707777777777077777777777777777777777077777777770777777777777777777777777777")
filpic7(0,yed2a+130,"77777777770007777070007777000077777000707700007777707777770007077070007777700777777700777077707777770777700070077070007777000077")
filpic7(0,yed2a+131,"77777777777770777007770770777707770777007077770770000077707770077007770777770777777770777077077777770777707707707007770770777707")
filpic7(0,yed2a+132,"77777777770000777077770770777777770777707000000777707777707770077077770777770777777770777070777777770777707707707077770770777707")
filpic7(0,yed2a+133,"77777777707770777007770770777707770777007077777777707777770007077077770777770777777770777007077777770777707707707077770770777707")
filpic7(0,yed2a+134,"77777777770007077070007777000077777000707700007777707777777777077077770777700077707770777077707777700077707707707077770777000077")
filpic7(0,yed2a+135,"77777777777777777777777777777777777777777777777777777777770000777777777777777777770007777777777777777777777777777777777777777777")
filpic7(0,yed2a+136,"77777777777777777777777777777777777077777777777777777777777777777777777777777777777777777777077777770777777707777777077777770777")
filpic7(0,yed2a+137,"77777777777777777777777777777777777077777777777777777777777777777777777777777777777777777777077777770777777707777777077777770777")
filpic7(0,yed2a+138,"70700077770007077070007777000007700000777077770770777707707777707077707770777707700000077777077777770777777707777777077777770777")
filpic7(0,yed2a+139,"70077707707770077007770770777777777077777077770770777707707707707707077770777707777770777777077777770777777707777777077777770777")
filpic7(0,yed2a+140,"70077707707770077077777777000077777077777077770770777707707707707770777770777007777007770000000077770000000007777777000000000000")
filpic7(0,yed2a+141,"70700077770007077077777777777707777077077077770777077077707707707707077777000707770777777777077777777777777777777777077777777777")
filpic7(0,yed2a+142,"70777777777777077077777770000077777700777700007777700777770070077077707777777707700000077777077777777777777777777777077777777777")
filpic7(0,yed2a+143,"70777777777777077777777777777777777777777777777777777777777777777777777777000077777777777777077777777777777777777777077777777777")
filpic7(0,yed2a+144,"77000077777707777700007777000077777770777000000777700077700000077700007777000077777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+145,"70777707777007777077770770777707777700777077777777077777707777077077770770777707777777777777777777777777777777077777777777777777")
filpic7(0,yed2a+146,"70777007770707777777770777777707777070777000077770777777777770777077770770777707777777777000000777770777777770777777777777777777")
filpic7(0,yed2a+147,"70700707777707777777007777000077770770777777707770000077777707777700007777000007700000077777777777777777777707777777777777777777")
filpic7(0,yed2a+148,"70077707777707777700777777777707700000077777770770777707777077777077770777777707777777777000000777777777777077777777777777777777")
filpic7(0,yed2a+149,"70777707777707777077777770777707777770777077707770777707777077777077770777777077777777777777777777770777770777777770077777770777")
filpic7(0,yed2a+150,"77000077770000077000000777000077777770777700077777000077777077777700007777000777777777777777777777770777707777777770077777770777")
filpic7(0,yed2a+151,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777707777777777777777777777707777")
filpic7(0,yed2a+152,"77777777707777770777777777777770777777777770777700000000007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+153,"00000000707777770777777777777770777777777770777700000000007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+154,"77777777707777770777777777777770777777777770777777777777007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+155,"77777777707777770777777777777770000000007770777777777777007777777777777777777077777777777777000077777777777777707777777777777700")
filpic7(0,yed2a+156,"77777777707777770777777777777770777777777770777777777777007777777777777777777077000000007777000077777777777777707777777777777700")
filpic7(0,yed2a+157,"77777777707777770777777777777770777777777770777777777777007777770000000077777077000000007777000077777777777777707777777777777700")
filpic7(0,yed2a+158,"77777777707777770777777777777770777777777770777777777777007777777777777777777077000000007777000077777777777777700000000077777700")
filpic7(0,yed2a+159,"77777777707777770000000000000000777777777770777777777777007777777777777777777077000000007777000000000000777777700000000077777700")
filpic7(0,yed2a+160,"77777777777707770000000000000000777707777777777777770777777777777777777777000077000000007777777777777777077777777777777077777777")
filpic7(0,yed2a+161,"77777777777000777000000000000000777000777777777777700077770000777700007770777707007777007777777777777777007777777777770077777777")
filpic7(0,yed2a+162,"77770777770000077700000000000000770000077770777777070707700000077077770777777707077777707777777777777777000777777777700077770777")
filpic7(0,yed2a+163,"77777077700000007770000000000000700000007707777770000000700000077077770777770077077777707777777777777777000077777777000077777777")
filpic7(0,yed2a+164,"00000007700000007777000000000000770000077000000077070707700000077077770777707777077777707777770000777777000007777770000077777777")
filpic7(0,yed2a+165,"77777077777000777777700000000000777000777707777777770777700000077077770777777777077777707777707777077777000000777700000077770777")
filpic7(0,yed2a+166,"77770777770000077777770000000000777707777770777777770777770000777700007777707777007777007777077777707777000000077000000077777777")
filpic7(0,yed2a+167,"77777777777777777777777000000000777777777777777777777777777777777777777777777777000000007777077777707777000000000000000077777777")
filpic7(0,yed2a+168,"77777777777700077700007777007007770000777770007700000000700077770707777777777777070707070000777777777777777777777777077777777777")
filpic7(0,yed2a+169,"77770777777007777707777770000000777770777707770700000007777007777070777770777777707070700000777777777777777777777777077777777777")
filpic7(0,yed2a+170,"77700077770077777707777770000000777770777077070700000077777700770707777777077777070707070000777777777777777777777777077777777777")
filpic7(0,yed2a+171,"77070707700777777707777770000000777770777070700700000777777770077070777777707777707070700000777777777777777777777777077777777777")
filpic7(0,yed2a+172,"77770777770077777707777777000007777770777077007700007777777700770707777777770777070707077777000077770000000077770000077700000000")
filpic7(0,yed2a+173,"77770777777007777707777777700077777770777707777700077777777007777070777777777077707070707777000077770777777077777777077777770777")
filpic7(0,yed2a+174,"77770777777700077700007777770777770000777770000700777777700077770707777777777707070707077777000077770777777077777777077777770777")
filpic7(0,yed2a+175,"77777777777777777777777777777777777777777777777707777777777777777070777777777777707070707777000077770777777077777777077777770777")
filpic7(0,yed2a+176,"77777777777707777707707777077077777707777777777777007777777770777777707777077777777777777777077777770000077777707770777777770777")
filpic7(0,yed2a+177,"77777777777707777707707777077077777000077007770770770777777707777777077777707777777707777707070777770000707777077770777777770777")
filpic7(0,yed2a+178,"77777770777707777707707770000007770707777007707770770777777077777770777777770777777707777770007777770000770770777707777777777077")
filpic7(0,yed2a+179,"77000007777707777777777777077077777000777777077777007777777777777770777777770777770000077700000777770000777007770077777777777700")
filpic7(0,yed2a+180,"70707077777777777777777770000007777707077770777770770707777777777770777777770777777707777770007700007777777007777777777777777777")
filpic7(0,yed2a+181,"77707077777777777777777777077077777000777707700770777077777777777777077777707777777707777707070700007777770770777777777777777777")
filpic7(0,yed2a+182,"77707077777707777777777777077077777707777077700777000707777777777777707777077777777777777777077700007777707777077777777777777777")
filpic7(0,yed2a+183,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777700007777077777707777777777777777")
filpic7(0,yed2a+184,"00000000077777770000000000000000777777777707777777777077770777777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+185,"77777777077777770777777777777770777777777707777777770777777077777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+186,"77777777077777770777777777777770000000007707777777707770077707777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+187,"77777777077777770777777777777770777777777707777777077707707770777777777777770777000000000000777777777777777777077777777777777000")
filpic7(0,yed2a+188,"77777777077777770777777777777770777777777707777770777077770777070000000077770777777777770000777777777777777777077777777777777000")
filpic7(0,yed2a+189,"77777777077777770777777777777770777777777707777707770777777077707777777777770777777777770000777777777777777777070000000077777000")
filpic7(0,yed2a+190,"77777777077777770777777777777770777777777707777777707777777707777777777777770777777777770000777700000000777777070000000077777000")
filpic7(0,yed2a+191,"77777777077777770777777777777770777777777707777777077777777770777777777777770777777777770000777777777777777777070000000077777000")
filpic7(0,yed2a+192,"77777777777077777777777777000077707777770777707707777077777077777777007707700007777077777700077770777077770777777000777770077777")
filpic7(0,yed2a+193,"77770777000000070000007777770777707777770777770707700007700000077770077707777777700000077070707770777077000007777770777777777777")
filpic7(0,yed2a+194,"77770777770777777777770777707777707777770777770707777077777707777700777707777777777077770770770770777077770777777770707707700077")
filpic7(0,yed2a+195,"77770777700000777777777770000007707777770777770707777077700000077007777707777777700000070770770770077077000007777000000707077707")
filpic7(0,yed2a+196,"77070707777777077777777777770777707770770777770707700077777770777700777707777777777077770770770777777077770777070770707700777707")
filpic7(0,yed2a+197,"77700077777777070777777777707777707770770770777707077007777777077770077707707777700077770770770777770777770777070770707707777707")
filpic7(0,yed2a+198,"77770777000000777000000777770077770007777007777770700077700777777777007700700007077000777007707777707777777000777007707777700077")
filpic7(0,yed2a+199,"77777777777777777777777777777777777777777777777777777777777007777777777777777777700077077777777777777777777777777777777777777777")
filpic7(0,yed2a+200,"70777077770777777777077777077777770777077707777700077777000000077707777777707777077777777000007707777077777000077777777777777777")
filpic7(0,yed2a+201,"70777077000000770000000777077707000007700000070777077007777770770000000777077777700000777777077707000007777077777707777777777777")
filpic7(0,yed2a+202,"00000007707777777777077777070077770770707077777070777070777707777770777777077777777777077770777707777077777077777000777770700777")
filpic7(0,yed2a+203,"70777077707000077700077777007777770770777077707707777077777077777777077770007777777777077707007707777077777077777707777700077077")
filpic7(0,yed2a+204,"70700777077777777077077770777777770770770770007707777077777077777077707770770777777777077077770707777077777777777000077777070777")
filpic7(0,yed2a+205,"70777777070777777700077707777777770770770707700707770777777707777707777707770777777770777777770707777077777777770770707777077777")
filpic7(0,yed2a+206,"77000007070000077777077770000007707707777770007770007777777770777770077707777007777007777707707770770777777777777007077777707777")
filpic7(0,yed2a+207,"77777777777777777770777777777777777777777777777777777777777777777777777777777777777777777770077777777777777777777777777777777777")
filpic7(0,yed2a+208,"77077777777770777700077777077777777007777770777777077777707707777777077777770777077000077777777777077777777770777000007777077777")
filpic7(0,yed2a+209,"00077077707770777777777700000077777777777777777700000070707700770770007777770007077770777707777700077007707770777777077700077077")
filpic7(0,yed2a+210,"77070707700000777770777777077777770000777000007777077770770077070707070777770777077000077070777777070077700000777770777777070707")
filpic7(0,yed2a+211,"77007707707707077077070770000077707777077777077770000077770777070077070777770777077770770777077777007077707707077700007777007707")
filpic7(0,yed2a+212,"77077707070077077077070707070707777777077770777707077707770770770077070770000777077000777777707770077077070077077077770770077007")
filpic7(0,yed2a+213,"70077707077070000777070707707707777770777707077707077707777077770777007707770007070770077777770707077077077077077770070707070700")
filpic7(0,yed2a+214,"07077077700770077700777770077077777707777077700770077077777077777770077770000777007000777777770777077707700770777707707777077007")
filpic7(0,yed2a+215,"77777777777777777777777777777777777777777777777777777777777707777777777777777777777777777777777777777777777777777770077777777777")
filpic7(0,yed2a+216,"77077777777777777777777777777777777077777777777777777777777777777700077777777777777777777777777777077777777777777777777777777777")
filpic7(0,yed2a+217,"00000070777777777777777777777777000000077777777777077777777777777707077777777777770777777777777707707777777777777707777777777777")
filpic7(0,yed2a+218,"77077770777777777077077777707777770777777777777777777777770777777700077777777777777777777777777770777777777777777000707777777777")
filpic7(0,yed2a+219,"70077777777777777077707707000777700070777777777770000777770007777777777777777777700007770000077777777777777777777707777777700077")
filpic7(0,yed2a+220,"07077777777777777077707700707077070007777777777777777077770777777777777777777777777077777777707777777777777777777000077777777777")
filpic7(0,yed2a+221,"70077707777707777077707707700777707707777077777777777077700007777777777777777777770077777777707777777777700077770707707777777777")
filpic7(0,yed2a+222,"77000007777707777707777777007777700000077707777777770777700777777777777777077777707700777770077777777777707077777007077777777777")
filpic7(0,yed2a+223,"77777777777707777777777777777777777777777770777777777777777777777777777777777777777777777777777777777777700077777777777777777777")
filpic7(0,yed2a+224,"77700077000000000000000000000000000000000700007000077700777007770007777777077707777000777777777777777777770777077700007777000077")
filpic7(0,yed2a+225,"77700077000070000000700000000000000000000700007000700070770770777077700077000007777000777770777007770777777070777000000770777707")
filpic7(0,yed2a+226,"77000007000070000007770000007000000700000700007007000000700000077077770777070707777707770070770770770700777707770000000007777770")
filpic7(0,yed2a+227,"77700077000070000070707000000700007000000777777007000000000000007000000777770777770000070000007777000000777707770070070007077070")
filpic7(0,yed2a+228,"77770777007070700000700007777770077777700700007007000000707007077077770777770777777707770070770770770700770000070000000007777770")
filpic7(0,yed2a+229,"77777777000777000000700000000700007000000700007000700070770770777077700070770770777707777770777007770777777707770007700007700770")
filpic7(0,yed2a+230,"77000007000070000000700000007000000700000700007000077700777777770007777770000000777070777777777777777777777000777000000770777707")
filpic7(0,yed2a+231,"77777777000000000000000000000000000000000000000000000000777777777777777770777770770777077777777777777777777000777700007777000077")
filpic7(0,yed2a+232,"77000007770000077777077777770777777707777777077777777777777707777707777777777077777707777700077770000000770777077777007777777777")
filpic7(0,yed2a+233,"77077707770777077707070777770770777707777770707777770777707707777700000770000007777070777770770770770770777070777770770700777777")
filpic7(0,yed2a+234,"77077707770000077707070777000707770000077700000777770777700000077077077770707077770777077000000070770770770000077770777700770777")
filpic7(0,yed2a+235,"77000007770777077777077777770077777707777077077077000007707707777700007770000000700000007770700070000000777707777700077770707077")
filpic7(0,yed2a+236,"77077707770000077770707777700077777000777700000777770777770000077707077770707707777077077700070070777770777000777770777770707077")
filpic7(0,yed2a+237,"77077707770777077707770777070707770707077770007777770777777707777000000770000000777077077070770770777770777707777770777770707070")
filpic7(0,yed2a+238,"77000007707777077077777070770770707707707770007770000000700000007777077777770707770770777770707770777770777707777700000777077707")
filpic7(0,yed2a+239,"77777777777777777777777777777777777777777000000077777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+240,"77777777777777077777770777777777777777777777777777777777777777777777777707770777070707770777777777777777777707777777077770707070")
filpic7(0,yed2a+241,"77777777777777077777770777777777777700070000000070007777007770777707770007707777070077777077777777777777777707777770777707070707")
filpic7(0,yed2a+242,"77777777777777077777770777077777777077707777777707770777070770777707707007077777070007777707777777077077770000077707777770707070")
filpic7(0,yed2a+243,"77777777777777077777770770707777770777070777777070777077077070777707077000777777007777777770777777077077777777777770777707070707")
filpic7(0,yed2a+244,"77777777777777077777770707770777007770777077770777077700077700000000777000777777007777777770000000077000777777777777077770707070")
filpic7(0,yed2a+245,"77777707777777077777770777777070777770777077770777077777077070777707077007070777070777777707777777077077770000077777707707070707")
filpic7(0,yed2a+246,"00000000777770000000000077777707777777070777777070777777070770777707707007700777077077777077777777077077777707777777770770707070")
filpic7(0,yed2a+247,"77777707777777077777770777777777777777707777777707777777007770777707770007000777077707770777777777777777777707777777707707070707")
filpic7(0,yed2a+248,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+249,"77777777700077777777700070007000777777777000777777777000700070007777777770007777777770007000700077777777700077777777700070007000")
filpic7(0,yed2a+250,"77777777700077777777700070007000777777777000777777777000700070007777777770007777777770007000700077777777700077777777700070007000")
filpic7(0,yed2a+251,"77777777700077777777700070007000777777777000777777777000700070007777777770007777777770007000700077777777700077777777700070007000")
filpic7(0,yed2a+252,"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777")
filpic7(0,yed2a+253,"77777777777777777777777777777777700077777000777770007777700077777777700077777000777770007777700070007000700070007000700070007000")
filpic7(0,yed2a+254,"77777777777777777777777777777777700077777000777770007777700077777777700077777000777770007777700070007000700070007000700070007000")
filpic7(0,yed2a+255,"77777777777777777777777777777777700077777000777770007777700077777777700077777000777770007777700070007000700070007000700070007000")

filpic7(128,yed2a+000,"77444456454545544475744657444555"):filpic7(128,yed2a+001,"77665566565667656675666656666566")
filpic7(128,yed2a+002,"44554445645555555555547575757575"):filpic7(128,yed2a+003,"67656665765566556676565475577455")
filpic7(128,yed2a+004,"44656454654545544444666677767777"):filpic7(128,yed2a+005,"55654665656655675566776676676676")
filpic7(128,yed2a+006,"55575775555733377775777077757773"):filpic7(128,yed2a+007,"77574554775777375575007055753373")
filpic7(128,yed2a+008,"76433000436753335564337777377377"):filpic7(128,yed2a+009,"55437300645575335567337557033077")
filpic7(128,yed2a+010,"65555621655403554767440777777577"):filpic7(128,yed2a+011,"76655664656537564776447074475554")
filpic7(128,yed2a+012,"65756644645646766666655370555775"):filpic7(128,yed2a+013,"56777755756555777667766507557777")
filpic7(128,yed2a+014,"55574554555775577775000777757772"):filpic7(128,yed2a+015,"77575775775757755575770755752272")
filpic7(128,yed2a+016,"76546566567576536576657555546564"):filpic7(128,yed2a+017,"65766576667666767666767676666676")
filpic7(128,yed2a+018,"55646557556456645467645565566566"):filpic7(128,yed2a+019,"66756667666766767666765576777666")
filpic7(128,yed2a+020,"55656563546564557554646667766664"):filpic7(128,yed2a+021,"76667676766566676565657656666465")
filpic7(128,yed2a+022,"67777676547765663777667667776576"):filpic7(128,yed2a+023,"65667565766775557777657577376577")
filpic7(128,yed2a+024,"53011201103321333454533553652244"):filpic7(128,yed2a+025,"65120112211111665553655665532244")
filpic7(128,yed2a+026,"44536464645465544433544342545546"):filpic7(128,yed2a+027,"55646664644364535554665566655655")
filpic7(128,yed2a+028,"77757567655556466447365766656744"):filpic7(128,yed2a+029,"54745475656656444436475555657544")
filpic7(128,yed2a+030,"77377333773773337737733377377333"):filpic7(128,yed2a+031,"77777777373737377373737333333333")
filpic7(128,yed2a+032,"77664666646655654676755675555666"):filpic7(128,yed2a+033,"77555556644567546675655675646655")
filpic7(128,yed2a+034,"56655666466666666666657575757575"):filpic7(128,yed2a+035,"46646755665566546654555475577455")
filpic7(128,yed2a+036,"44656454654545544444666677767777"):filpic7(128,yed2a+037,"55654665656655675566776676676676")
filpic7(128,yed2a+038,"55575775555733377775777077757773"):filpic7(128,yed2a+039,"77574554775777375575007055753373")
filpic7(128,yed2a+040,"76433000436753335564337777377377"):filpic7(128,yed2a+041,"55437300645575335567337557033077")
filpic7(128,yed2a+042,"65555621655403554767440777777577"):filpic7(128,yed2a+043,"76655664656537564776447074475554")
filpic7(128,yed2a+044,"65756644645646766666655370555775"):filpic7(128,yed2a+045,"56777755756555777667766507557777")
filpic7(128,yed2a+046,"55574554555765567775000777757772"):filpic7(128,yed2a+047,"77575775775756655575770755752272")
filpic7(128,yed2a+048,"76355644575554445656343555363546"):filpic7(128,yed2a+049,"65555676565744666646364676654655")
filpic7(128,yed2a+050,"44354456444545554547555544565756"):filpic7(128,yed2a+051,"55465656665456766665766566774667")
filpic7(128,yed2a+052,"45545635555634554474435745544545"):filpic7(128,yed2a+053,"56445545766646665545447656465554")
filpic7(128,yed2a+054,"35776657357757675677575757775776"):filpic7(128,yed2a+055,"45766646456776477777567677374677")
filpic7(128,yed2a+056,"53011201103321333454533553652244"):filpic7(128,yed2a+057,"65120112211111665553655665532244")
filpic7(128,yed2a+058,"44446464645465544433544342545546"):filpic7(128,yed2a+059,"55556664644264535554665566755655")
filpic7(128,yed2a+060,"77757567655556466447365766656744"):filpic7(128,yed2a+061,"54745475656656444436475555657544")
filpic7(128,yed2a+062,"77377333773773337737733377377333"):filpic7(128,yed2a+063,"77777777373737377373737333333333")

for y1=0 to (yed/2)-1:for x1=0 to (xed/2)-1:dfi=65536:fgx=0:fgy=0:chid=0
  for yq=0 to 31:for xq=0 to 15:cnt=0
    for y2=0 to 1:for x2=0 to 1
      q1=bitwiseand(point(160+(x1*2)+x2,yed2a+(y1*2)+y2),255)
      q2=bitwiseand(point(128+(xq*2)+x2,yed2a+0+(yq*2)+y2),255)
      dq=abs(q2-q1):cnt=cnt+dq
      next:next
    if cnt<dfi then:dfi=cnt:fgx=xq:fgy=yq:end if
    next:next
  for y2=0 to 7:for x2=0 to 7
    c=point((fgx*8)+x2,yed2a+(fgy*8)+y2):ink(c):dot((x1*8)+x2,(y1*8)+y2)
    next:next:next:next


  fout$=finp$+".bmp":grab (1,0,0,xed2a,yed2a):saveimage (fout$,1)
'- unix only (?) - needs imagemagick installed
  shell("convert "+fout$+" "+fout$+".png"):shell("rm "+fout$+" "+finp2$)  

waitkey




